import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '供应商编码',
    align: "center",
    dataIndex: 'code'
  },
  {
    title: '供应商名称',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '供应商简称',
    align: "center",
    dataIndex: 'shortname'
  },
  {
    title: '对应客户',
    align: "center",
    dataIndex: 'corcustomer'
  },
  {
    title: '启用状态',
    align: "center",
    dataIndex: 'enablestate',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
     },
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '供应商编码',
    field: 'code',
    component: 'Input',
  },
  {
    label: '供应商名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '供应商简称',
    field: 'shortname',
    component: 'Input',
  },
  {
    label: '对应客户',
    field: 'corcustomer',
    component: 'Input',
  },
  {
    label: '启用状态',
    field: 'enablestate',
    component: 'JSwitch',
    componentProps:{
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  code: {title: '供应商编码',order: 0,view: 'text', type: 'string',},
  name: {title: '供应商名称',order: 1,view: 'text', type: 'string',},
  shortname: {title: '供应商简称',order: 2,view: 'text', type: 'string',},
  corcustomer: {title: '对应客户',order: 3,view: 'text', type: 'string',},
  enablestate: {title: '启用状态',order: 4,view: 'number', type: 'number',},
};
